import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView.vue'),
    meta: { title: '首页' }
  },
  {
    path: '/impression',
    name: 'impression',
    component: () => import('@/views/ImpressionView.vue'),
    meta: { title: '曝光日志' }
  },
  {
    path: '/change',
    name: 'change',
    component: () => import('@/views/ChangeView.vue'),
    meta: { title: '变化查询' }
  },
  {
    path: '/statistics',
    name: 'statistics',
    component: () => import('@/views/StatisticsView.vue'),
    meta: { title: '统计查询' }
  },
  {
    path: '/analysis',
    name: 'analysis',
    component: () => import('@/views/AnalysisView.vue'),
    meta: { title: '分析与推荐' }
  },
  {
    path: '/query',
    name: 'query',
    component: () => import('@/views/QueryView.vue'),
    meta: { title: '查询日志' }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
